package org.example.mystaterdemo.config;

import org.example.mystaterdemo.MyTestInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 我的测试web mvc配置
 *
 * @author ez4sterben
 * @date 2023/07/18
 */
@Configuration
public class MyTestWebMvcConfig implements WebMvcConfigurer {
    {
        System.out.println("init................");
    }

    public MyTestWebMvcConfig() {
        System.out.println("MyTestWebMvcConfig................");
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyTestInterceptor())
                .addPathPatterns("/**");
    }
}

